package singleton

import "fmt"

var (
	orgMap map[int]int
)

func GetOrgIdMapping(orgId int, info string) int {
	if orgId == 0 {
		return 0
	}

	r := orgMap[orgId]
	if r == 0 {
		panic(fmt.Sprintf("no org mapping %d,info: %s", orgId, info))
	}
	return r
}

func InitOrgMapping(a map[int]int) {
	orgMap = a
}
